<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */

get_header(); ?>

<div class="content_inner">
	<div>
		<div class="content_text_holder2">
			<h2><?php the_title(); ?></h2>
			<?php // Get RSS Feed(s)
			include_once(ABSPATH . WPINC . '/feed.php');

			// Get a SimplePie feed object from the specified feed source.
			$rss = fetch_feed('http://creativewithcode.com/tianavonjohnson/feed/rss');
			if (!is_wp_error( $rss ) ) : // Checks that the object is created correctly 
				// Figure out how many total items there are, but limit it to 5. 
				$maxitems = $rss->get_item_quantity(5); 

				// Build an array of all the items, starting with element 0 (first element).
				$rss_items = $rss->get_items(0, $maxitems); 
			endif;
			?>

			<ul>
				<?php if ($maxitems == 0) echo '<li>No items.</li>';
				else
				// Loop through each feed item and display each item as a hyperlink.
				foreach ( $rss_items as $item ) : ?>
				<li>
					<a href='<?php echo esc_url( $item->get_permalink() ); ?>'
					title='<?php echo 'Posted '.$item->get_date('j F Y | g:i a'); ?>'>
					<?php echo esc_html( $item->get_title() ); ?></a>
				</li>
				<?php endforeach; ?>
			</ul>
		</div>
	</div><!-- END Content Left -->
</div><!-- END content -->

</div><!-- END content holder -->
<div class="content_holder_footer2"></div>
<?php get_footer(); ?>


